//
//  ShowWebViewController.m
//  MyTravel
//
//  Created by Hunk on 11-6-27.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "ShowWebViewController.h"
#import "MyLoadingView.h"

@implementation ShowWebViewController
@synthesize urlString;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)dealloc
{
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.title = @"团游世界";
    
    [[MyLoadingView sharedMyLoadingView] startLoadingAnimation];
    
    UIWebView* webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 416)];
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlString]]];
    [webView setDelegate:self];
    [self.view addSubview:webView];
    [webView release];
}

#pragma mark -
#pragma mark UIWebView delegate methods
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    [[MyLoadingView sharedMyLoadingView] stopLoadingAnimation];
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
